<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-04 16:53:56
 * @LastEditTime: 2023-06-28 15:11:51
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description: 
 */

namespace App\Http\Services\BaseData;

use App\Http\Services\Service;

use App\Repositories\TypeRepository;
use Illuminate\Support\Facades\DB;

/**
 * @property TypeRepository $repository
 */
class TypeService extends Service
    {

    public function __construct(TypeRepository $repository)
        {
        $this->repository = $repository;
        }

    public function list()
        {
        $data = $this->repository->condition(request())->getGrid();
        return $data;
        }
    protected function save($request)
        {
        // DB::enableQueryLog();
        // dd(DB::getQueryLog());
        return $this->repository->autosave($request->toArray());
        }
    protected function delete()
        {
        return $this->repository->autodelete($this->getRequestIds());
        }

    }